package com.one.group.model.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;


/**
* 收费标准表
* @TableName sp_charge_standards
*/
@Table(value ="sp_charge_standards")
@Data
public class SpChargeStandards implements Serializable {

    /**
    * 收费标准id
    */
    @Id(keyType = KeyType.Auto)
    private Long id;
    /**
    * 收费标准名
    */

    private String name;
    /**
    * 收费项目id
    */

    private Long chargeitemId;
    /**
    * 小区id
    */

    private Long cellId;
    /**
    * 一次收费金额
    */

    private BigDecimal price;
    /**
    * 收费规格（0：一次收费，1：每小时，2：每天，3：每周，4：每月，5：每年）
    */
    private Integer timeset;
    /**
    * 价位字段
    */

    private String pricestr;
    /**
    * 备注
    */

    private String remarks;
    /**
    * 创建时间
    */

    private Date createTime;
    /**
    * 更新时间
    */

    private Date updateTime;
    /**
    * 租户id
    */
    @Column(tenantId = true)
    private Long tenantId;

    /**
    * 自动生成加个字段
    */
    public void setPricestr(){
        switch (timeset){
            case 0:
                pricestr = "单价:"+price+"￥";
                break;
            case 1:
                pricestr = "每小时:"+price+"￥";
                break;
            case 2:
                pricestr = "每一天:"+price+"￥";
                break;
            case 3:
                pricestr = "每一周:"+price+"￥";
                break;
            case 4:
                pricestr = "每个月:"+price+"￥";
                break;
            case 5:
                pricestr = "每一年:"+price+"￥";
                break;
        }
    }
}
